<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>激活码生成</title>
    <link rel="stylesheet" type="text/css" href="/static/css/animate.min.css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/public.css"/>
    <script src="/static/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/static/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
    <script src="/static/js/mui.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/static/js/index.js" type="text/javascript" charset="utf-8"></script>
    <script src="/static/layer/mobile/layer.js" type="text/javascript" charset="utf-8"></script>
</head>
<body style="background: #f5f5f5;">
	<div class="header">
		<a href="/index/" class="backPage"></a>
		<p class="page_title">激活码生成</p>
	</div>
	<div style="width: 100%; height: 0.88rem; background: none;"></div>
	<div class="jhmBegin">
		<p>请输入申请个数</p>
		<input type="number" name="num" />
	</div>
	<div class="login_btn">生成</div>
	<!-- <form method="post" action="{:url('index/dowload')}">
        <input type="hidden" name="min" >
        <input type="hidden" name="load_num" >
        <button class="load_btn" style="display: block;">下载</button>
    </form> -->
</body>
<script type="text/javascript">
	$('.login_btn').click(function() {
        var num=$("input[name='num']").val();
        if(num == ''){
            layer.open({
                content: '请输入申请个数'
                ,skin: 'msg'
                ,time: 2 //2秒后自动关闭
            });
            
            return false;
        }
        $.ajax({
            type : "POST",
            url:"/active/",//+tab,
            headers:{"X-CSRFToken":$.cookie('csrftoken')},
            data:{'num':num}, 
            dataType:'json',		
            success: function(data){
               if(data.code == 1){
                    layer.open({
                        content: data.msg
                        ,skin: 'msg'
                        ,time: 3 //2秒后自动关闭
                    });
                    <!-- $("input[name='min']").val(data.data.min) -->
                    <!-- $("input[name='load_num']").val(data.data.num) -->
                    setTimeout(function(){
                        window.location.href="/active_list/"
                    },700);
                }else{
                    layer.open({
                        content: data.msg
                        ,skin: 'msg'
                        ,time: 2 //2秒后自动关闭
                    });
                }	
            }
        });
    });
    
</script>
</html>